<template>
	<view>
		<view class="container">
			<view class="header">
				<view class="title">
					<text>我的</text>
				</view>
				<view class="title-icon">
					<view class="title-icon-text">
						<text>改</text>
					</view>
				</view>
				<!-- 头像 -->
				<view class="headshot">
					<image class="headshotImg" src="../../../../static/logo.png" mode=""></image>
				</view>
				<!-- 相机 -->
				<view class="changeHeadshot" @tap="changeHeadshot">
					<image class="changeHeadshotImg" src="../../../../static/logo.png" mode=""></image>

				</view>

			</view>

			<view class="content">
				<view class="userInfo">
					<view class="username">
						<text> {{username}} 您好！</text>
					</view>
					<view class="Id">
						<text>ID:{{ID}}</text>
					</view>
				</view>

				<view class="userMsg">
					<view class="phone">
						<text>电话：{{phone}}</text>
					</view>
					<view class="name">
						<text>姓名：{{username}}</text>
					</view>
					<view class="sex">
						<radio-group name="sex" @change="changeRadio" style="transform:scale(1)">
							<label>性别：</label>
							<label>
								<radio value="男" checked="checked" disabled="true" /><text>男</text>
								<radio value="女" disabled="true" /><text>女</text>
							</label>
						</radio-group>

					</view>
					<view class="bindDate">
						<text>出生日期：{{bindDate}}</text>
					</view>
					<view class="homeId">
						<text>家庭ID：{{homeId}}</text>
					</view>
					<view class="communityId">
						<text>社区ID：{{communityId}}</text>
					</view>

				</view>


			</view>

		</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				username: '张三 ',
				ID: 'cs12345678',
				phone: '15012916690',
				sex: 1,
				bindDate: '1961/03/15',
				homeId: 'cs12345678',
				communityId: 'cs12345678'

			}
		},
<<<<<<< HEAD
		onLoad() {


		},
=======
		// onLoad() {
		// 	uni.hideTabBar();
		// },
>>>>>>> b0cc8c0 (hello)
		methods: {
			//调用相机
			changeHeadshot() {
				uni.chooseImage({
					count: 1,
					sizeType: ['original', 'compressed'],
					sourceType: ['camera', 'album'], //camera掉拍照，album是打开手机相册
					success: (res) => {
						console.log(res);
						const tempFilePaths = res.tempFilePaths; //转存地址
						uni.showLoading({
							title: '正在上传头像...'
						})
						// uni.$request.sendUploadFile('', {
						// 	// fileType: "image",
						// 	filePath: tempFilePaths[0],
						// 	name: 'imgFile',
						// }).then(data =>{
						// 	console.log('data',data);
						// 	if(data.data.code == 200){
						// 		uni.$request.post('',{
						// 			data:data,
						// 		}).then(data=>{
						// 			console.log('data',data);
									
						// 		})
						// 	}
							
						// })

					}
				})
			}
		}
	}
</script>

<style>
	.container {
		height: 100vh;
		width: 100vw;
	}

	.header {
		height: 30vh;
		width: 100vw;
		z-index: -999;
		background-color: #FFB938;
		/* display: flex; */
	}

	.title {
		/* justify-content: left; */
		width: 20%;
		height: 5vh;
		float: left;
		margin: 3vh 0 0 4vw;
		font-size: 48rpx;
		font-weight: bold;

	}

	.title-icon {
		height: 150rpx;
		width: 150rpx;
		/* text-align: center; */
		background-color: #F6681D;
		/* background-image: url(../../static/logo.png); */
		/* overflow: hidden; */
		/* background-size: cover; */
		float: right;
		margin-top: 5vh;
		margin-right: 4vw;
		border-radius: 50%;
	}

	.title-icon-text {
		width: 100%;
		height: 100%;
		display: block;
		justify-content: center;
		margin-top: 10%;
		/* margin: 0 auto; */
		text-align: center;
		font-size: 80rpx;
		color: #ffffff;

	}

	.headshot {
		z-index: 100;
		height: 200rpx;
		width: 200rpx;
		position: relative;
		top: 15vh;
		margin: 0 auto;
		/* left: 50vw; */
		/* margin:10vh auto; */
		/* background-color: #007AFF; */
		/* display: flex; */
		overflow: hidden;
		/* align-items: center; */
		border-radius: 50%;
		border: 5rpx solid #ffffff;
	}

	.headshotImg {
		max-width: 100%;
		max-height: 100%;
	}


	.changeHeadshot {
		height: 100rpx;
		width: 100rpx;
		border-radius: 50%;
		background-color: #00FF7F;
		border: 5rpx solid #ffffff;
		/* display: flex; */
		/* float: right; */
		overflow: hidden;
		/* margin-top: 3vh; */
		/* margin-right: 5vw; */
		z-index: 999;
		position: relative;
		margin: 0 auto;
		top: 110rpx;
		left: 180rpx;
	}

	.changeHeadshotImg {
		max-width: 100%;
		max-height: 100%;
	}

	.content {
		height: 70vh;
		width: 90%;
		margin: 0 auto;
		background-color: #ffffff;
		border: 1px solid #bfbfbf;
		box-shadow: 0 0 10px 2px #bdcee0;
		border-radius: 4vw;
		position: relative;
		top: -7vh;
	}

	.userInfo {
		/* display: flex; */
		justify-content: center;
		width: 50vw;
		height: 180rpx;
		margin: 0 auto;
		margin-top: 12vh;
		/* margin-left: 3vw; */
		text-align: center;
		line-height: 70rpx;
	}

	.username {
		display: flex;
		justify-content: center;
		margin: 0 auto;
		width: 100%;
		font-size: 48rpx;
		font-weight: bold;
		text-align: center;
		white-space: nowrap;
	}

	.Id {
		display: flex;
		justify-content: center;
		text-align: center;
		margin: 0 auto;
		width: 100%;
		font-size: 42rpx;
		white-space: nowrap;
		color: #F6681D;
	}

	.userMsg {
		display: block;
		justify-content: left;
		height: 50vh;
		width: 100%;
		line-height: 100rpx;
		/* margin-left: 20vw; */
		/* margin: 0 auto; */

	}

	.phone,
	.name,
	.sex,
	.bindDate,
	.homeId,
	.communityId {
		display: flex;
		justify-content: center;
		text-align: center;
		margin: 0 auto;
	}

	.phone,
	.name,
	.bindDate,
	.homeId,
	.communityId,
	.sex {
		font-size: 48rpx;
	}
</style>
